home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / networking / misc / sana2.lha / sana2 / examples / online / online.c < prev   
Encoding:
C/C++ Source or Header  |  1991-11-18  |  899 b   |  51 lines

  1. /*
  2. **  $Id: online.c,v 1.4 91/11/13 11:10:51 dlarson Exp $
  3. **
  4. **  SANA-II driver utility -- Make offline driver come online.
  5. **
  6. **  Copyright 1991 Commodore-Amiga, Inc.
  7. **
  8. **  This code may be modified and used freely on Amiga computers.
  9. **
  10. */
  11.  
  12. #define NOBUFFS
  13. #include "/skeleton/skeleton.h"
  14.  
  15. struct MsgPort   *DevPort = NULL;
  16. struct IOSana2Req *IOB1    = NULL;
  17.  
  18. int    DeviceOpen = 0;
  19. long   DevBits;
  20.  
  21. void DoOnLine();
  22.  
  23.  
  24. main(argc , argv)
  25. char *argv[];
  26. {
  27.     if(!initdev())
  28.         printf("Open Failed\n");
  29.     else
  30.     {
  31.         printf("Attempting To Go OnLine\n");
  32.         DoOnLine();
  33.         if(IOB1->ios2_Req.io_Error)
  34.             printf("Error: %ld WireError: %ld\n",
  35.                 (long)IOB1->ios2_Req.io_Error,
  36.                 IOB1->ios2_WireError);
  37.         else
  38.             printf("No Error\n");
  39.  
  40.     }
  41. bottom:    closedev();
  42. }
  43.  
  44. void DoOnLine()
  45. {
  46.     IOB1->ios2_Req.io_Error   = 0;
  47.     IOB1->ios2_Req.io_Flags   = IOF_QUICK;
  48.     IOB1->ios2_Req.io_Command = S2_ONLINE;
  49.     DoIO(IOB1);
  50. }
  51.